<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>小站零食店后台系统</title>
<link rel="stylesheet" href="css/login.css">
<link rel="short icon" href="../images/yc.png" type="image/x-icon">
</head>
<body>
<div id="login_top">
	<div id="welcome">
		欢迎使用小站零食店后台管理系统
	</div>
	<div id="back">
		<a href="../index.html">返回首页</a>&nbsp;&nbsp; | &nbsp;&nbsp;
		<a href="#">帮助</a>
	</div>
</div>
<div id="login_center">
	<div id="login_area">
		<div id="login_form">
			<form action="" method="post" id="myform">
				<div id="login_tip">
					用户登录&nbsp;&nbsp;UserLogin
				</div>
				<div><input type="text" class="aname" id="aname" placeholder="请输入账号..." value="小站"></div>
				<div><input type="password" class="apwd" id="apwd" placeholder="请输入密码..." value="123456"></div>
				<div id="btn_area">
					<input type="button"  onclick="checkLogin()" id="sub_btn" value="登&nbsp;&nbsp;录">&nbsp;&nbsp;
				</div>
			</form>
		</div>
	</div>
</div>
<div id="login_bottom">
	<label style="color:#FFF"><a class="copy">小站零食 </a>&copy; 版权所有</label>
</div>
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="js/vue.js"></script>
<script type="text/javascript" src="js/axios.js"></script>
<script type="text/javascript" src="js/qs.js"></script>

<script type="text/javascript">
function checkLogin(){
	console.info("65846854646")
	var aname = document.getElementById('aname').value;  
    var apwd = document.getElementById('apwd').value;  
	
	if (aname == "" || apwd == "") {
		return;
	}
	
	$.post("/admin/login", {aname:aname, apwd:apwd}, rt => {
		if (rt.code == 200) {
			location.href="manager/index.html";
			return;
		}
		alert("您输入的账号或密码有误，请确认后重新登录...");
	}, "json");
}
</script>
</body>
</html>